﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OQualityStrategyAdd.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.MacModel.OQualityStrategyAdd" %>

<div class="pageContent">
	<form method="post" action="MacModel/OQualityStrategyAdd.aspx?ajaxmethod=<%=Action %>&action=<%=Action %>&QSID=<%=QSID %>" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
		<div class="pageFormContent" layoutH="56">
            <p>
				<label>问题归类：</label>
                <select name="ProblemClass" class="required" selectvalue="<%=OQualityStrategyObj.ProblemClass %>">
                    <option value="市怨" selected >市怨</option>
                    <option value="厂异">厂异</option>
                    <option value="其他">其他</option>
                </select>
			</p>
            <p>
				<label>对策编号：</label>
				<input name="DuiCuBianHao" type="text" readonly class="required" value="<%=OQualityStrategyObj.DuiCuBianHao %>" />
			</p>
            <div class="divider"></div>
            <p>
				<label>问题点单号：</label>
				<input name="RelevantEntryNum" type="text" class="required" value="<%=OQualityStrategyObj.RelevantEntryNum %>" />
               
			</p>
            <div class="divider"></div>
            
            <dl class="nowrap">
				<dt>机型：</dt>
                <dd>
                  <%=GetMacType("checkbox","MacType",OQualityStrategyObj.MacType) %>
                </dd>
            </dl>
            <div class="divider"></div>
            <p>
				<label>零件号：</label>
				<input name="ItemCode" type="text"  class="required" value="<%=OQualityStrategyObj.ItemCode %>" />
			</p>
            <p>
				<label>零件名：</label>
				<input name="ItemName" type="text"  class="required" value="<%=OQualityStrategyObj.ItemName %>" />
			</p>
            <div class="divider"></div>
             <p>
				<label>发生数量：</label>
				<input name="Frequency" type="text"  class="required" value="<%=OQualityStrategyObj.Frequency %>" />
			</p>
            <p>
				<label>是否再发：</label>
				<input name="Tiems" type="text"  class="required" value="<%=OQualityStrategyObj.Tiems %>" />
			</p>
            <div class="divider"></div>
             <p>
				<label>有无对策报告：</label>
                 <select name="DuiceReport" class="required"  id="OQualityStrategyAddDuiceReport" selectvalue="<%=OQualityStrategyObj.DuiceReport %>">
                     <option value="有">有</option>
                     <option value="无">无</option>
                 </select>
			</p>
            <dl id="OQualityStrategyAddDuiceReportUpload" style="width:100%; height:60px;">
				<dt>&nbsp;</dt>
				<dd>
                    对策报告附件
					<table border="0" cellpadding="2" style="border-spacing:2px!important;width:400px;">                        
                        <tr>
                            <asp:repeater id="rpDuiceReportAtt" runat="server">
                            <ItemTemplate>
                            <td> 
                                <input name="ID" type="hidden" value="<%# Eval("ID") %>" />
                                <input name="AttType" type="hidden" value="duicireport" />
                                <input  id="duicireportHiddenId" name="AttPath" type="hidden" value="<%# Eval("AttPath") %>" />
				                <input type='file' name='filedata' id='duicireportUploadId' upload='upload' clientId='duicireportHiddenId,duicireportRemarkId' dirtype='20' onUploadSuccess='onOQualityStrategyAddUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                            </td>
                            <td><input name="Remark" id='duicireportRemarkId' type="text"   value="<%# Eval("Remark") %>" /></td>      
                             <td width="100px">
                                 <a target="_blank" class="downloadhref" href="<%# Eval("AttPath") %>">下载</a>
                             </td>                       
                        </tr>
                       </ItemTemplate>
                     </asp:repeater>   
                    </table>
				</dd>
			</dl>

            <div class="divider"></div>
            <dl style="width:100%; height:60px;">
				<dt>故障描述：</dt>
				<dd>
					<textarea name="FaultDescription" cols="80" rows="4" ><%=OQualityStrategyObj.FaultDescription %></textarea>
				</dd>
			</dl>
             <dl style="width:100%; height:150px;">
				<dt>&nbsp;</dt>
				<dd>
                    故障描述说明附件
                    <table border="0" cellpadding="2" style="border-spacing:5px!important;width:400px;"> 
                        <asp:repeater id="rpfaultdescription" runat="server">
                            <ItemTemplate>                        
                                <tr>
                                    <td><%# Container.ItemIndex + 1%>：</td>
                                    <td> 
                                        <input name="ID" type="hidden" value="<%# Eval("ID") %>" />
                                        <input name="AttType" type="hidden" value="faultdescription" />
                                        <input  id="faultdescriptionHiddenId<%# Container.ItemIndex + 1%>" name="AttPath" type="hidden" value="<%# Eval("AttPath") %>" />
				                        <input type='file' name='filedata' id='faultdescriptionUploadId<%# Container.ItemIndex + 1%>' upload='upload' clientId='faultdescriptionHiddenId<%# Container.ItemIndex + 1%>,faultdescriptionRemarkId<%# Container.ItemIndex + 1%>' dirtype='20' onUploadSuccess='onOQualityStrategyAddUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                                    </td>
                                    <td><input name="Remark" id='faultdescriptionRemarkId<%# Container.ItemIndex + 1%>' type="text"   value="<%# Eval("Remark") %>" /></td> 
                                      <td width="100px">
                                        <a target="_blank" class="downloadhref" href="<%# Eval("AttPath") %>">下载</a>
                                    </td>                            
                                </tr>
                         </ItemTemplate>
                        </asp:repeater>  
                    </table>                    
                   
				</dd>
			</dl>
            <div class="divider"></div>
            <dl style="width:100%; height:60px;">
				<dt>原因分析：</dt>
				<dd>
					<textarea name="CauseAnalysis" cols="80" rows="4" ><%=OQualityStrategyObj.CauseAnalysis %></textarea>
				</dd>
			</dl>
            <dl style="width:100%; height:110px;">
				<dt>&nbsp;</dt>
				<dd>
                    原因分析说明附件
                    <table border="0" cellpadding="2" style="border-spacing:10px!important;width:400px;">  
                        <asp:repeater id="rpcauseanalysis" runat="server">
                            <ItemTemplate>                         
                                <tr>
                                     <td><%# Container.ItemIndex + 1%>：</td>
                                    <td> 
                                        <input name="ID" type="hidden" value="<%# Eval("ID") %>" />
                                        <input name="AttType" type="hidden" value="causeanalysis" />
                                        <input  id="causeanalysisHiddenId<%# Container.ItemIndex + 1%>" name="AttPath" type="hidden" value="<%# Eval("AttPath") %>" />
				                        <input type='file' name='filedata' id='causeanalysisUploadId<%# Container.ItemIndex + 1%>' upload='upload' clientId='causeanalysisHiddenId<%# Container.ItemIndex + 1%>,causeanalysisRemarkId<%# Container.ItemIndex + 1%>' dirtype='20' onUploadSuccess='onOQualityStrategyAddUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                                    </td>
                                    <td><input name="Remark" id="causeanalysisRemarkId<%# Container.ItemIndex + 1%>" type="text"   value="<%# Eval("Remark") %>" /></td>
                                    <td width="100px">
                                        <a target="_blank" class="downloadhref" href="<%# Eval("AttPath") %>">下载</a>
                                    </td>                             
                                </tr>
                              </ItemTemplate>
                        </asp:repeater>  

                       
                    </table>                    
                   
				</dd>
			</dl>
        </div>
		<div class="formBar">
			<ul>
				
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script>
    $(document).ready(function () {
        $(":file[upload]").each(function () {
                   uploadifyFun($(this));
         });
       
        $("#OQualityStrategyAddDuiceReport").change(function () {
            ///alert($(this).val());
            if ($(this).val() == "有") {
                $("#OQualityStrategyAddDuiceReportUpload").show();
            } else {
                $("#OQualityStrategyAddDuiceReportUpload").hide();
            }
        })

        $("select[selectvalue]").each(function () {
            var $selectvalue = $(this).attr("selectvalue");
            $(this).find("option[value='" + $selectvalue + "']").attr("selected", true);
        });
        $("a.downloadhref").each(function () {
            var $href = $(this).attr("href");
            if ($href == "")
                $(this).hide();
        });
    })
    function onOQualityStrategyAddUploadSuccess(file, data, response) {
        if (!response)
            return false;
        data = eval("(" + data + ")");
        if (!data.uploadResult) {
            alert(data.errMsg);
            return;
        }
        var $imgUploadPath = data.filePath;
        var $trageIds = data.customerInfo.split(",");      
        $("#" + $trageIds[0]).val($imgUploadPath);
        $("#" + $trageIds[1]).val(data.soureFileName);//soureFileName
    }
</script>